package com.cib.ccc.poc.servlet;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.cib.ccc.poc.data.bean.BatchBean;
import com.cib.ccc.poc.data.service.BatchService;

@Controller
@RequestMapping(value="/batch")
public class BatchServlet {

	@Autowired
	BatchService service;
	
	@RequestMapping(value="/query")
	public ModelAndView query(@RequestParam("batchId") String batchId)
	{
		System.out.println("hello>>>>>>>>>");
		BatchBean bean = service.findByID(batchId);
		
		ModelAndView mav = new ModelAndView();
		mav.setViewName("batch");
		mav.addObject("batch", bean);		
		return mav;
	}
	
}
